package com.ctrip.ibu.member.broker.module;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author he.shaorong
 * @create 2023/3/27 19:38
 * @since 1.0.0
 */
@ApiModel("消息内容")
public class MessageInfo {
    @ApiModelProperty("消息json")
    private String messageJson;

    @ApiModelProperty("消息Id")
    private String messageId;

    @ApiModelProperty("消息主题")
    private String topic;

    @ApiModelProperty("是否全部完成")
    private boolean isAllFinished = false;

    @ApiModelProperty("是否支持该消息消费")
    private boolean supportThisTopic = false;

    public MessageInfo() {
    }

    public MessageInfo(String messageJson) {
        this.messageJson = messageJson;
    }

    public String getMessageJson() {
        return messageJson;
    }

    public void setMessageJson(String messageJson) {
        this.messageJson = messageJson;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public boolean isAllFinished() {
        return isAllFinished;
    }

    public void setAllFinished(boolean allFinished) {
        isAllFinished = allFinished;
    }

    public boolean isSupportThisTopic() {
        return supportThisTopic;
    }

    public void setSupportThisTopic(boolean supportThisTopic) {
        this.supportThisTopic = supportThisTopic;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    @Override
    public boolean equals(Object b) {
        if(b instanceof MessageInfo) {
            return this.messageId.equals(((MessageInfo)b).getMessageId());
        }
        return false;
    }
}
